source, destination);
}
+#ifdef HAVE_TLS
+
+static __thread char buf[1024];
+
+static char *
+create_name (const Babl *source,
+ const Babl *destination,
+ int is_reference)
+{
+ int size = 0;
+
+ size = create_name_internal (buf, sizeof(buf), source, destination, is_reference);
+
+ if (size < 0)
+ return NULL;
+
+ return buf;
+}
+
+
+#else
+
static char *
create_name (const Babl *source,
const Babl *destination,
return buf;
}
+#endif
Babl *
babl_fish_reference (const Babl *source,
/* There is an instance already registered by the required name,
* returning the preexistent one instead.
*/
+#ifndef HAVE_TLS
free (name);
+#endif
return babl;
}
* name, inserting newly created class into database.
*/
babl_db_insert (babl_fish_db (), babl);
+#ifndef HAVE_TLS
free (name);
+#endif
return babl;
}
dnl ===========================================================================
+#################
+# Check for some not-so-common features
+#################
+
+# babl_fish_reference(), create_name() would like this
+AC_MSG_CHECKING([for __thread])
+AC_LINK_IFELSE([AC_LANG_PROGRAM(, [static __thread char buf[1024];])],
+ [AC_DEFINE(HAVE_TLS, 1,
+ Define to 1 if compiler supports __thread)
+ AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])])
+
+
+dnl ===========================================================================
+
+
########################
# Check for MMX assembly
########################